import 'package:flutter/material.dart';
import 'list_vertical_view.dart';

class HorizonListView extends StatelessWidget {
  const HorizonListView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 180.0,
      padding: EdgeInsets.all(5.0),
      child: ListView(
        scrollDirection: Axis.horizontal, //水平滑动
        children: [
          Container(
            width: 180.0,
            height: 180.0,
            color: Colors.red,
            margin: EdgeInsets.fromLTRB(0, 0, 5.0, 0),
          ),
          Container(
            width: 180.0,
            height: 180.0,
            color: Colors.yellow,
            child: VerticalListView(),
          ),
          Container(
            width: 180.0,
            height: 180.0,
            color: Colors.green,
          ),
          Container(
            width: 180.0,
            height: 180.0,
            color: Colors.greenAccent,
          ),
          Container(
            width: 180.0,
            height: 180.0,
            color: Colors.blue,
          ),
          Container(
            width: 180.0,
            height: 180.0,
            color: Colors.blueGrey,
          ),
        ],
      ),
    );
  }
}
